<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<%@ taglib prefix="s" uri="/struts-tags"%>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<link href="../main.css" rel="stylesheet" type="text/css"/>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<script>
    function find(){
       if (document.all.findbutton.value=="重填"){
            document.all.findbutton.value="查找"
            document.all.goodsId.readOnly=false;
            document.all.goodsName.readOnly=false;
            document.all.spec.readOnly=false;
            document.all.trademark.readOnly=false;       
       }else{
         if (document.all.goodsId.value==""){
             alert("请输入物品编号！");
             return;
         }
         document.all.act.value="search";
         document.all.form.submit();
       }
    }
    function check(){
       if (confirm("您确定要提交入库单吗？")){
          if (document.all.goodsId.value==""){
             alert("请输入物品编号！");
             return;
         }
         if (document.all.quantity.value==""||!/^[1-9]\d*$/.test(document.all.quantity.value)){
                alert("请输入正确的入库数量！");
               return;               
         }
          document.all.act.value="save";      
          document.all.form.submit();
       }
    }
    </script>
</head>
	<body>
	    <form action="inbill!insert.do" name="form" method="post">
		<table class="tableborder" cellspacing="1" cellpadding="4" width="98%" align="center">
			<colgroup align="left">
				<col class="altbg1" width="20%"/>							
				<col class="altbg2" width="30%"/>
				<col class="altbg1" width="20%"/>
				<col class="altbg2" width="30%"/>
			</colgroup>
			<tr>
			   <td colspan="4" class="header">新增入库单<input type="hidden" name="act"/></td>
			</tr>
			<tr>
				<td><font color="red">*</font>物品编号：</td>
				<td><input name="goodsId" type="text" maxlength="40" value=""/><input type="button" name="findbutton" value="查找" onclick="find();"/></td>
				<td><font color="red">*</font>入库人员：</td>
				<td><span><s:property value=""/></span></td>
			</tr>
			<tr>
				<td><font color="red">*</font>物品名称：</td>
				<td><input name="goodsName" type="text" value="" maxlength="40"/></td>
				<td><font color="red">*</font>入库日期：</td>
				<td><span></span>
				</td>
			</tr>
			<tr>
				<td><font color="red">*</font>牌号：</td>
				<td><input name="trademark" type="text" value="" maxlength="40"/></td>
				<td><font color="red">*</font>库房编号：</td>
				<td><span></span></td>
			</tr>
			<tr>
				<td><font color="red">*</font>规格：</td>
				<td><input name="spec" type="text" value="" maxlength="40"/></td>
				<td><font color="red">*</font>入库数量：</td>
				<td><input name="quantity" type="text" maxlength="10"/></td>
			</tr>
			<tr>
				<td colspan="4" bgcolor="d6e0ef" align="center"><input name="button" type="button"  value="入库" onclick="check();"/></td>
			</tr>
      </table>
      </form>
	</body>
</html>
